<!-- 绿色通道 - 患者列表 - 医疗记录 - 辅助检查 界面 -->
<template>
  <div id="box">
    <div style="width: 100%;border-bottom: 1px solid #DFDEE3;margin: -11px 0px 10px 0px" />
    <!-- <div id="summaryCount" class="tab-content tab_content_div" style="margin-top: 100px" /> -->
    <div v-show="accessory_examination.length === 0">
      <center>
        <h3>无数据</h3>
      </center>
    </div>
    <div class="pr-5 mr-10 textR">
      <el-button @click="getElectrocardiograph()">获取心电图机数据</el-button>
      <el-button type="primary" @click="dialogVisible = true">新增</el-button>
    </div>

    <el-dialog title="新增检查" :visible.sync="dialogVisible" width="80%">
      <div id="addRef" ref="addRef">
        <!-- :rules="newExamineRules" -->
        <el-form ref="newExamine" :model="newExamine" label-width="120px">
          <el-row>
            <el-col :span="24">
              <el-form-item label="检查类型" prop="inspectionType">
                <el-select v-model="newExamine.inspectionType" placeholder="请选择" @change="clearExamineform()">
                  <el-option label="心电图" value="心电图" />
                  <el-option label="CT" value="CT" />
                  <el-option label="超声" value="超声" />
                  <el-option label="MRI" value="MRI" class="required-field" />
                  <el-option label="CTA" value="CTA" class="required-field" />
                  <el-option label="MRA" value="MRA" class="required-field" />
                  <el-option label="DSA" value="DSA" class="required-field" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="开具单据" prop="openerTime">
                <el-date-picker v-model="newExamine.openerTime" format="yyyy-MM-dd HH:mm:ss"
                  value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="11">
              <el-form-item :label="newExamine.inspectionType === 'MRI' ? '到达MRI室时间' : '检查开始'" prop="uploadTime">
                <el-date-picker v-model="newExamine.uploadTime" format="yyyy-MM-dd HH:mm:ss"
                  value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="11">
              <el-form-item v-if="newExamine.inspectionType === 'MRI'" label="离开MRI室时间" prop="uploadTime">
                <el-date-picker v-model="newExamine.diagnosticTime" format="yyyy-MM-dd HH:mm:ss"
                  value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item v-if="newExamine.inspectionType !== 'MRI'" label="报告完成" prop="reporttime">
                <el-date-picker v-model="newExamine.reporttime" format="yyyy-MM-dd HH:mm:ss"
                  value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="11">
              <el-form-item v-if="['CTA', 'MRA', 'DSA'].includes(newExamine.inspectionType)" label="检查部位"
                prop="checkPoint" required>
                <el-select v-model="newExamine.checkPoint" placeholder="请选择"
                  @change="newExamine.impression = ''; newExamine.pathogeny = ''; newExamine.aneurysmCount = ''">
                  <el-option label="颈部血管" value="颈部血管" />
                  <el-option label="颅内血管" value="颅内血管" />
                </el-select>
              </el-form-item>
            </el-col>

            <el-col v-if="['CT'].includes(newExamine.inspectionType)" :span="24">
              <el-col :span="12">
                <el-form-item label="CT检查结束时间" prop="checkendtime">
                  <el-date-picker v-model="newExamine.checkendtime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <!-- <el-col :span="11">
                <el-form-item label="CT报告时间" prop="reporttime">
                  <el-date-picker v-model="newExamine.reporttime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col> -->
            </el-col>

            <el-col v-if="newExamine.inspectionType === '心电图'" :span="24">
              <el-col :span="19">
                <el-form-item label="心电印象" prop="impression">
                  <!-- <el-input v-model="item.impression" disabled /> -->
                  <div class="el-input__inner" style="height: auto;min-height: 40px;">
                    {{ newExamine.impression }}
                    <!-- {{ newExamine.impression }} -->
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="3">
                <el-form-item label-width="0">
                  <el-button class="ml-10"
                    @click="impressPublic('ECG_impression_dialog', newExamine.impression, undefined)">选择</el-button>
                </el-form-item>
              </el-col>
            </el-col>

            <el-col v-if="['CT', 'MRI'].includes(newExamine.inspectionType)" :span="24">
              <el-col :span="9">
                <el-form-item :label="newExamine.inspectionType === 'MRI' ? '印象' : 'CT印象'" prop="impression">
                  <div class="el-input__inner" style="height: auto;min-height: 40px;">
                    {{ tag_impression(['leftRight', 'bleedingSite', 'bleedingSize'], newExamine.impression) }}
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="2">
                <el-form-item label-width="0"><el-button class="ml-10"
                    @click="impressPublic('CT_impression_dialog', newExamine.impression, undefined); ct_or_mri = 'ct'">选择</el-button></el-form-item>
              </el-col>
              <el-col :span="9" :offset="1" v-if="['CT'].includes(newExamine.inspectionType)">
                <el-form-item label="CT报告" prop="reportcontent">
                  <div class="el-input__inner" style="height: auto;min-height: 40px;">{{ newExamine.reportcontent }}
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="2" v-if="['CT'].includes(newExamine.inspectionType)">
                <el-form-item label-width="0"><el-button class="ml-10"
                    @click="impressPublic('CT_reportcontent_dialog', newExamine.reportcontent, undefined); ct_or_mri = 'ct';">选择</el-button></el-form-item>
              </el-col>
              <el-col :span="24" v-if="['CT'].includes(newExamine.inspectionType)">
                <el-col :span="9">
                  <el-form-item label="ASPECT评分" prop="aspectScore">
                    <!-- <div class="el-input__inner" style="height: auto;min-height: 40px;">{{ newExamine.aspectScore.split(";")[0] }}</div> -->
                    <div class="el-input__inner" style="height: auto;min-height: 40px;">{{
                      newExamine.aspectScore ? newExamine.aspectScore.split(";")[0] : "" }}
                    </div>
                  </el-form-item>
                </el-col>
                <el-col :span="5">
                  <el-form-item label-width="0"><el-button class="ml-10"
                      @click="impressPublic('CT_aspect_dialog', newExamine.aspectScore, undefined); ct_or_mri = 'ct'; CT_aspectPop.aspectList = []; CT_aspectPop.score = 14">选择</el-button></el-form-item>
                </el-col>
              </el-col>
              <el-col :span="24" v-if="['CT'].includes(newExamine.inspectionType)">
                <el-col :span="9">
                  <el-form-item label="PC-ASPECT评分" prop="aspectScore" label-width="130px">
                    <!-- <div class="el-input__inner" style="height: auto;min-height: 40px;">{{ newExamine.aspectScore.split(";")[0] }}</div> -->
                    <div class="el-input__inner" style="height: auto;min-height: 40px;">{{
                      newExamine.pc_aspectScore ? newExamine.pc_aspectScore.split(";")[0] : "" }}
                    </div>
                  </el-form-item>
                </el-col>
                <el-col :span="5">
                  <el-form-item label-width="0"><el-button class="ml-10"
                      @click="impressPublic('CT_PC_aspect_dialog', newExamine.pc_aspectScore, undefined); ct_or_mri = 'ct'; CT_PC_aspectPop.aspectList = []; CT_PC_aspectPop.score = 10">选择</el-button></el-form-item>
                </el-col>
              </el-col>
            </el-col>

            <el-col v-if="newExamine.inspectionType === '超声'" :span="24">
              <el-col :span="9">
                <el-form-item label="印象" prop="impression">
                  <div class="el-input__inner " style="height: auto;min-height: 40px;">{{ tag_impression(['side',
                    'position', 'degreeStenosis'], newExamine.impression) }}</div>
                </el-form-item>
              </el-col>
              <el-col :span="3">
                <el-form-item label-width="0"><el-button class="ml-10"
                    @click="impressPublic('UCMD_dialog', newExamine.impression, undefined); Ult_CTA_MRA_DSA = 'Ult'">选择</el-button></el-form-item>
              </el-col>
            </el-col>

            <el-col v-if="['CTA', 'MRA', 'DSA'].includes(newExamine.inspectionType)" :span="24">
              <!-- 颈部血管 -->
              <el-col v-show="newExamine.checkPoint == '颈部血管'">
                <el-col :span="9">
                  <el-form-item label="印象" prop="impression">
                    <div class="el-input__inner " style="height: auto;min-height: 40px;">{{ tag_impression(['side',
                      'position', 'degreeStenosis'], newExamine.impression) }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="2">
                  <el-form-item label-width="0"><el-button class="ml-10"
                      @click="impressPublic('UCMD_dialog', newExamine.impression, undefined); Ult_CTA_MRA_DSA = 'CTA'">选择</el-button></el-form-item>
                </el-col>
              </el-col>

              <!-- 颅内血管 -->
              <el-col v-show="newExamine.checkPoint == '颅内血管'">
                <el-col :span="24">
                  <el-col :span="9">
                    <el-form-item label="印象" prop="impression">
                      <div class="el-input__inner " style="height: auto;min-height: 40px;">{{
                        tag_impression(['side', 'position', 'position1', 'longs', 'width', 'height', 'tumorDiameter',
                          'type'],
                          newExamine.impression) }}</div>
                    </el-form-item>
                  </el-col>
                  <el-col :span="2">
                    <el-form-item label-width="0"><el-button class="ml-10"
                        @click="impressPublic('CTA_MRA_DSA_dialog', newExamine.impression, undefined); Ult_CTA_MRA_DSA = 'CTA'">选择</el-button></el-form-item>
                  </el-col>
                </el-col>
                <el-col :span="24">
                  <el-col :span="9">
                    <el-form-item label="动脉瘤数量" prop="aneurysmCount">
                      <div class="el-input__inner " style="height: auto;min-height: 40px;">{{ newExamine.aneurysmCount
                        }}
                      </div>
                    </el-form-item>
                  </el-col>
                </el-col>
                <el-col :span="24">
                  <el-col :span="9">
                    <el-form-item label="病因诊断" prop="pathogeny">
                      <div class="el-input__inner " style="height: auto;min-height: 40px;">{{ newExamine.pathogeny }}
                      </div>
                    </el-form-item>
                  </el-col>
                  <el-col :span="2">
                    <el-form-item label-width="0"><el-button class="ml-10"
                        @click="impressPublic('CTA_MRA_DSA_pathogeny_dialog', newExamine.pathogeny, undefined); Ult_CTA_MRA_DSA = 'CTA'">选择</el-button></el-form-item>
                  </el-col>
                </el-col>
              </el-col>
            </el-col>
            <el-col :span="24">
              <el-form-item label="检查图片" prop="imgUrl">
                <el-upload class="avatar-uploader" action="#" list-type="text" :on-change="imgUpload"
                  :auto-upload="false" :show-file-list="false">
                  <img v-if="newExamine.imgUrl" :src="newExamine.imgUrl" class="avatar">
                  <i v-else class="el-icon-plus avatar-uploader-icon" />
                </el-upload>
              </el-form-item>
            </el-col>
            <el-col :span="18">
              <el-form-item label="备注" prop="remark">
                <el-input v-model="newExamine.remark" placeholder="请输入备注" />
              </el-form-item>
            </el-col>
            <el-col :span="24"><el-divider /></el-col>
          </el-row>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="saveCheck(newExamine)">确 定</el-button>
      </span>
    </el-dialog> <!-- 新增弹窗 -->
    <el-form class="demo-form-inline" label-width="100px">
      <!--
					心电图模块
			-->
      <!-- <span class="mr-10">{{item.hospital}}</span> -->
      <div v-for="(item, index) in ECG_list" :key="item.updatedAt + index" class="pageDateStyle">
        <el-card shadow="never" style="background: #eee;">
          <div class="dataTitleStyle">
            <div class="fl"><b>心电图</b></div>
            <div class="fr">
              <el-button type="primary" size="small" class="ml-10" @click="saveCheck(item)">保存</el-button>
            </div>
            <div class="fr">
              <span class="mr-10">{{ item.updatedAt }}</span>

              <span class="mr-10">{{ item.department }}</span>
              <span class="mr-10">{{ item.userName }}</span>
            </div>
          </div>
          <div class="AData">
            <el-col :span="10">
              <el-form-item label="开具单据">
                <el-date-picker v-model="item.openerTime" format="yyyy-MM-dd HH:mm:ss"
                  value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="检查开始">
                <el-date-picker v-model="item.uploadTime" format="yyyy-MM-dd HH:mm:ss"
                  value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="报告时间">
                <el-date-picker v-model="item.reporttime" format="yyyy-MM-dd HH:mm:ss"
                  value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-col :span="9">
                <el-form-item label="心电印象">
                  <!-- <el-input v-model="item.impression" disabled /> -->
                  <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">
                    <!-- {{ item.impression }} -->
                    {{ item.impression }}
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="3">
                <el-form-item label-width="0">
                  <el-button @click="impressPublic('ECG_impression_dialog', item.impression, index)">选择</el-button>
                </el-form-item>
              </el-col>
            </el-col>

            <el-col :span="24">
              <el-col :span="8" style="position: relative;">
                <el-form-item label="图片">
                  <el-image :src="item.imgUrl" alt="" :preview-src-list="[item.imgUrl]" class="showImgStyle"
                    style="height: 100%;  vertical-align: bottom;" @click.stop="handleClick">
                    <div slot="placeholder" class="image-slot ml-10">
                      加载中<span class="dot">...</span>
                    </div>
                  </el-image>
                  <el-upload class="modifyImgBtn" action="#" list-type="text"
                    :on-change="(res, file) => { imgModify(res, file, item) }" :auto-upload="false"
                    :show-file-list="false">
                    <el-button size="small">点击上传</el-button>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-col>
            <el-col :span="18">
              <el-form-item label="备注" prop="remark">
                <el-input v-model="item.remark" placeholder="请输入备注" />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-divider />
            </el-col>
          </div>
        </el-card>
      </div>
      <!--
						心电图模块-End
			-->
      <!-- CT模块 -->
      <!-- <span class="mr-10">{{item.hospital}}</span> -->
      <div v-for="(item, index) in CT_list" :key="item.updatedAt + index" class="pageDateStyle">
        <el-card shadow="never" style="background: #eee;">
          <div class="dataTitleStyle">
            <div class="fl"><b>CT</b></div>
            <div class="fr"><el-button type="primary" size="small" class="ml-10" @click="saveCheck(item)">保存</el-button>
            </div>
            <div class="fr">
              <span class="mr-10">{{ item.updatedAt }}</span>

              <span class="mr-10">{{ item.department }}</span>
              <span class="mr-10">{{ item.userName }}</span>
            </div>
          </div>
          <div class="AData">
            <el-row>
              <el-col :span="10">
                <el-form-item label="开具单据">
                  <el-date-picker v-model="item.openerTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="检查开始">
                  <el-date-picker v-model="item.uploadTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="9">
                <el-form-item label="CT印象">
                  <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">
                    {{ tag_impression(['leftRight', 'bleedingSite', 'bleedingSize'], item.impression) }}
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="2" label-width="0">
                <el-form-item label-width="0"><el-button
                    @click="impressPublic('CT_impression_dialog', item.impression, index); ct_or_mri = 'ct'">选择</el-button></el-form-item>
              </el-col>
              <!-- </el-row>
						<el-row> -->
              <el-col :span="9" :offset="1">
                <el-form-item label="CT报告">
                  <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{ item.reportcontent }}
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="2" label-width="0">
                <el-form-item label-width="0"><el-button
                    @click="impressPublic('CT_reportcontent_dialog', item.reportcontent, index); ct_or_mri = 'ct';">选择</el-button></el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="13">
                <el-form-item label="ASPECT评分">
                  <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{
                    item.aspectScore ? item.aspectScore.split(";")[0] : "" }}</div>
                </el-form-item>
              </el-col>
              <el-col :span="5" label-width="0">
                <el-form-item label-width="0"><el-button
                    @click="impressPublic('CT_aspect_dialog', item.aspectScore, index); ct_or_mri = 'ct'; CT_aspectPop.aspectList = []; CT_aspectPop.score = 14">选择</el-button></el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="13">
                <el-form-item label="PC-ASPECT评分" label-width="130px">
                  <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{
                    item.pathogeny ? item.pathogeny.split(";")[0] : "" }}</div>
                </el-form-item>
              </el-col>
              <el-col :span="5" label-width="0">
                <el-form-item label-width="0"><el-button
                    @click="impressPublic('CT_PC_aspect_dialog', item.pathogeny, index); ct_or_mri = 'ct'; CT_PC_aspectPop.aspectList = []; CT_PC_aspectPop.score = 10">选择</el-button></el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <el-form-item label="CT检查结束时间" label-width="130px">
                  <el-date-picker v-model="item.checkendtime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="CT报告时间">
                  <el-date-picker v-model="item.reporttime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-col :span="24">
              <el-col :span="8" style="position: relative;">
                <el-form-item label="图片">
                  <el-image :src="item.imgUrl" alt="" :preview-src-list="[item.imgUrl]" class="showImgStyle"
                    style="height: 100%;  vertical-align: bottom;" @click.stop="handleClick">
                    <div slot="placeholder" class="image-slot ml-10">
                      加载中<span class="dot">...</span>
                    </div>
                  </el-image>
                  <el-upload class="modifyImgBtn" action="#" list-type="text"
                    :on-change="(res, file) => { imgModify(res, file, item) }" :auto-upload="false"
                    :show-file-list="false">
                    <el-button size="small">点击上传</el-button>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-col>
            <el-col :span="18">
              <el-form-item label="备注" prop="remark">
                <el-input v-model="item.remark" placeholder="请输入备注" />
              </el-form-item>
            </el-col>
            <el-col :span="24"><el-divider /></el-col>
          </div>
        </el-card>
      </div>
      <!-- CT模块-End -->

      <!-- 超声 -->
      <!-- <span class="mr-10">{{item.hospital}}</span> -->
      <div v-for="(item, index) in Ultrasound_list" :key="'超声' + item.updatedAt + index" class="pageDateStyle">
        <el-card shadow="never" style="background: #eee;">
          <div class="dataTitleStyle">
            <div class="fl"><b>超声</b></div>
            <div class="fr"><el-button type="primary" size="small" class="ml-10" @click="saveCheck(item)">保存</el-button>
            </div>
            <div class="fr">
              <span class="mr-10">{{ item.updatedAt }}</span>

              <span class="mr-10">{{ item.department }}</span>
              <span class="mr-10">{{ item.userName }}</span>
            </div>
          </div>
          <div class="AData">
            <el-row>
              <el-col :span="10">
                <el-form-item label="开具单据">
                  <el-date-picker v-model="item.openerTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="检查开始">
                  <el-date-picker v-model="item.uploadTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="报告完成">
                  <el-date-picker v-model="item.reporttime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="9">
                <el-form-item label="印象">
                  <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{ tag_impression(['side',
                    'position', 'degreeStenosis'], item.impression) }}</div>
                </el-form-item>
              </el-col>
              <el-col :span="2" label-width="0">
                <el-form-item label-width="0"><el-button
                    @click="impressPublic('UCMD_dialog', item.impression, index); Ult_CTA_MRA_DSA = 'Ult'">选择</el-button></el-form-item>
              </el-col>
              <el-col :span="24">
                <el-col :span="8" style="position: relative;">
                  <el-form-item label="图片">
                    <el-image :src="item.imgUrl" alt="" :preview-src-list="[item.imgUrl]" class="showImgStyle"
                      style="height: 100%;  vertical-align: bottom;" @click.stop="handleClick">
                      <div slot="placeholder" class="image-slot ml-10">
                        加载中<span class="dot">...</span>
                      </div>
                    </el-image>
                    <el-upload class="modifyImgBtn" action="#" list-type="text"
                      :on-change="(res, file) => { imgModify(res, file, item) }" :auto-upload="false"
                      :show-file-list="false">
                      <el-button size="small">点击上传</el-button>
                    </el-upload>
                  </el-form-item>
                </el-col>
              </el-col>
              <el-col :span="18">
                <el-form-item label="备注" prop="remark">
                  <el-input v-model="item.remark" placeholder="请输入备注" />
                </el-form-item>
              </el-col>
              <el-col :span="24"><el-divider /></el-col>
            </el-row>
          </div>
        </el-card>
      </div>
      <!-- 超声-End -->
      <!-- MRI模块 -->
      <!-- <span class="mr-10">{{item.hospital}}</span> -->
      <div v-for="(item, index) in MRI_list" :key="'MRI模块' + item.updatedAt + index" class="pageDateStyle">
        <el-card shadow="never" style="background: #eee;">
          <div class="dataTitleStyle">
            <div class="fl"><b>MRI</b></div>
            <div class="fr"><el-button type="primary" size="small" class="ml-10" @click="saveCheck(item)">保存</el-button>
            </div>
            <div class="fr">
              <span class="mr-10">{{ item.updatedAt }}</span>

              <span class="mr-10">{{ item.department }}</span>
              <span class="mr-10">{{ item.userName }}</span>
            </div>
          </div>
          <div class="AData">
            <el-row>
              <el-col :span="8">
                <el-form-item label="开具单据">
                  <el-date-picker v-model="item.openerTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="到达MRI室时间" label-width="130px">
                  <el-date-picker v-model="item.uploadTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="离开MRI室时间" label-width="130px">
                  <el-date-picker v-model="item.diagnosticTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="9">
                <el-form-item label="印象">
                  <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">
                    {{ tag_impression(['side', 'position', 'degreeStenosis'], item.impression) }}
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="2" label-width="0">
                <el-form-item label-width="0"><el-button
                    @click="impressPublic('CT_impression_dialog', item.impression, index); ct_or_mri = 'mri'">选择</el-button></el-form-item>
              </el-col>
            </el-row>
            <el-col :span="24">
              <el-col :span="8" style="position: relative;">
                <el-form-item label="图片">
                  <el-image :src="item.imgUrl" alt="" :preview-src-list="[item.imgUrl]" class="showImgStyle"
                    style="height: 100%;  vertical-align: bottom;" @click.stop="handleClick">
                    <div slot="placeholder" class="image-slot ml-10">
                      加载中<span class="dot">...</span>
                    </div>
                  </el-image>
                  <el-upload class="modifyImgBtn" action="#" list-type="text"
                    :on-change="(res, file) => { imgModify(res, file, item) }" :auto-upload="false"
                    :show-file-list="false">
                    <el-button size="small">点击上传</el-button>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-col>
            <el-col :span="18">
              <el-form-item label="备注" prop="remark">
                <el-input v-model="item.remark" placeholder="请输入备注" />
              </el-form-item>
            </el-col>
            <el-col :span="24"><el-divider /></el-col>
          </div>
        </el-card>
      </div>
      <!-- MRI模块-End -->

      <!-- CTA -->
      <!-- <span class="mr-10">{{item.hospital}}</span> -->
      <div v-for="(item, index) in CTA_list" :key="item.updatedAt + index" class="pageDateStyle">
        <el-card shadow="never" style="background: #eee;">
          <div class="dataTitleStyle">
            <div class="fl"><b>CTA</b></div>
            <div class="fr"><el-button type="primary" size="small" class="ml-10" @click="saveCheck(item)">保存</el-button>
            </div>
            <div class="fr">
              <span class="mr-10">{{ item.updatedAt }}</span>

              <span class="mr-10">{{ item.department }}</span>
              <span class="mr-10">{{ item.userName }}</span>
            </div>
          </div>
          <div class="AData">
            <el-row>
              <el-col :span="10">
                <el-form-item label="开具单据">
                  <el-date-picker v-model="item.openerTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="检查开始">
                  <el-date-picker v-model="item.uploadTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="报告完成">
                  <el-date-picker v-model="item.reporttime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="检查部位">
                  <el-select v-model="item.checkPoint" placeholder="请选择"
                    @change="item.impression = ''; item.pathogeny = ''; item.aneurysmCount = ''">
                    <el-option label="颈部血管" value="颈部血管" />
                    <el-option label="颅内血管" value="颅内血管" />
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <!-- 颅内血管 -->
            <div v-show="item.checkPoint == '颅内血管'">
              <el-row>
                <el-col :span="15">
                  <el-form-item label="印象" label-width="80px">
                    <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{
                      tag_impression(['side', 'position', 'position1', 'longs', 'width', 'height', 'tumorDiameter',
                        'type'],
                        item.impression) }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="2" label-width="0">
                  <el-form-item label-width="0"><el-button
                      @click="impressPublic('CTA_MRA_DSA_dialog', item.impression, index); Ult_CTA_MRA_DSA = 'CTA'">选择</el-button></el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="动脉瘤数量">
                    <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{ item.aneurysmCount }}
                    </div>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="9">
                  <el-form-item label="病因诊断">
                    <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{ item.pathogeny }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="2" label-width="0">
                  <el-form-item label-width="0"><el-button
                      @click="impressPublic('CTA_MRA_DSA_pathogeny_dialog', item.pathogeny, index); Ult_CTA_MRA_DSA = 'CTA'">选择</el-button></el-form-item>
                </el-col>
              </el-row>
            </div>
            <el-row>
              <!-- 颈部血管 -->
              <el-row v-show="item.checkPoint == '颈部血管'">
                <el-col :span="9">
                  <el-form-item label="印象">
                    <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{ tag_impression(['side',
                      'position', 'degreeStenosis'], item.impression) }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="2" label-width="0">
                  <el-form-item label-width="0"><el-button
                      @click="impressPublic('UCMD_dialog', item.impression, index); Ult_CTA_MRA_DSA = 'CTA'">选择</el-button></el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-col :span="8" style="position: relative;">
                    <el-form-item label="图片">
                      <el-image :src="item.imgUrl" alt="" :preview-src-list="[item.imgUrl]" class="showImgStyle"
                        style="height: 100%;  vertical-align: bottom;" @click.stop="handleClick">
                        <div slot="placeholder" class="image-slot ml-10">
                          加载中<span class="dot">...</span>
                        </div>
                      </el-image>
                      <el-upload class="modifyImgBtn" action="#" list-type="text"
                        :on-change="(res, file) => { imgModify(res, file, item) }" :auto-upload="false"
                        :show-file-list="false">
                        <el-button size="small">点击上传</el-button>
                      </el-upload>
                    </el-form-item>
                  </el-col>
                </el-col>
                <el-col :span="18">
                  <el-form-item label="备注" prop="remark">
                    <el-input v-model="item.remark" placeholder="请输入备注" />
                  </el-form-item>
                </el-col>
                <el-col :span="24"><el-divider /></el-col>
              </el-row>
            </el-row>
          </div>
        </el-card>
      </div>
      <!-- CTA-End -->

      <!-- MRA -->
      <!-- <span class="mr-10">{{item.hospital}}</span> -->
      <div v-for="(item, index) in MRA_list" :key="item.updatedAt + index" class="pageDateStyle">
        <el-card shadow="never" style="background: #eee;">
          <div class="dataTitleStyle">
            <div class="fl"><b>MRA</b></div>
            <div class="fr"><el-button type="primary" size="small" class="ml-10" @click="saveCheck(item)">保存</el-button>
            </div>
            <div class="fr">
              <span class="mr-10">{{ item.updatedAt }}</span>

              <span class="mr-10">{{ item.department }}</span>
              <span class="mr-10">{{ item.userName }}</span>
            </div>
          </div>
          <div class="AData">
            <el-row>
              <el-col :span="10">
                <el-form-item label="开具单据">
                  <el-date-picker v-model="item.openerTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="检查开始">
                  <el-date-picker v-model="item.uploadTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="报告完成">
                  <el-date-picker v-model="item.reporttime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="检查部位">
                  <el-select v-model="item.checkPoint" placeholder="请选择"
                    @change="item.impression = ''; item.pathogeny = ''; item.aneurysmCount = ''">
                    <el-option label="颈部血管" value="颈部血管" />
                    <el-option label="颅内血管" value="颅内血管" />
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <!-- 颅内血管 -->
            <div v-show="item.checkPoint == '颅内血管'">
              <el-row>
                <el-col :span="15">
                  <el-form-item label="印象" label-width="80px">
                    <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{
                      tag_impression(['side', 'position', 'position1', 'longs', 'width', 'height', 'tumorDiameter',
                        'type'],
                        item.impression) }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="2" label-width="0">
                  <el-form-item label-width="0"><el-button
                      @click="impressPublic('CTA_MRA_DSA_dialog', item.impression, index); Ult_CTA_MRA_DSA = 'MRA'">选择</el-button></el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="动脉瘤数量">
                    <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{ item.aneurysmCount }}
                    </div>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="9">
                  <el-form-item label="病因诊断">
                    <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{ item.pathogeny }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="2" label-width="0">
                  <el-form-item label-width="0"><el-button
                      @click="impressPublic('CTA_MRA_DSA_pathogeny_dialog', item.pathogeny, index); Ult_CTA_MRA_DSA = 'MRA'">选择</el-button></el-form-item>
                </el-col>
              </el-row>
            </div>
            <el-row>
              <!-- 颈部血管 -->
              <el-row v-show="item.checkPoint == '颈部血管'">
                <el-col :span="9">
                  <el-form-item label="印象">
                    <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{ tag_impression(['side',
                      'position', 'degreeStenosis'], item.impression) }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="2" label-width="0">
                  <el-form-item label-width="0"><el-button
                      @click="impressPublic('UCMD_dialog', item.impression, index); Ult_CTA_MRA_DSA = 'MRA'">选择</el-button></el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-col :span="8" style="position: relative;">
                    <el-form-item label="图片">
                      <el-image :src="item.imgUrl" alt="" :preview-src-list="[item.imgUrl]" class="showImgStyle"
                        style="height: 100%;  vertical-align: bottom;" @click.stop="handleClick">
                        <div slot="placeholder" class="image-slot ml-10">
                          加载中<span class="dot">...</span>
                        </div>
                      </el-image>
                      <el-upload class="modifyImgBtn" action="#" list-type="text"
                        :on-change="(res, file) => { imgModify(res, file, item) }" :auto-upload="false"
                        :show-file-list="false">
                        <el-button size="small">点击上传</el-button>
                      </el-upload>
                    </el-form-item>
                  </el-col>
                </el-col>
                <el-col :span="18">
                  <el-form-item label="备注" prop="remark">
                    <el-input v-model="item.remark" placeholder="请输入备注" />
                  </el-form-item>
                </el-col>
                <el-col :span="24"><el-divider /></el-col>
              </el-row>
            </el-row>
          </div>
        </el-card>
      </div>
      <!-- MRA-End -->

      <!-- DSA -->
      <!-- <span class="mr-10">{{item.hospital}}</span> -->
      <div v-for="(item, index) in DSA_list" :key="item.updatedAt + index" class="pageDateStyle">
        <el-card shadow="never" style="background: #eee;">
          <div class="dataTitleStyle">
            <div class="fl"><b>DSA</b></div>
            <div class="fr"><el-button type="primary" size="small" class="ml-10" @click="saveCheck(item)">保存</el-button>
            </div>
            <div class="fr">
              <span class="mr-10">{{ item.updatedAt }}</span>

              <span class="mr-10">{{ item.department }}</span>
              <span class="mr-10">{{ item.userName }}</span>
            </div>
          </div>
          <div class="AData">
            <el-row>
              <el-col :span="10">
                <el-form-item label="开具单据">
                  <el-date-picker v-model="item.openerTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="检查开始">
                  <el-date-picker v-model="item.uploadTime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="报告完成">
                  <el-date-picker v-model="item.reporttime" format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="检查部位">
                  <el-select v-model="item.checkPoint" placeholder="请选择"
                    @change="item.impression = ''; item.pathogeny = ''; item.aneurysmCount = ''">
                    <el-option label="颈部血管" value="颈部血管" />
                    <el-option label="颅内血管" value="颅内血管" />
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <!-- 颅内血管 -->
            <div v-show="item.checkPoint == '颅内血管'">
              <el-row>
                <el-col :span="15">
                  <el-form-item label="印象" label-width="80px">
                    <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{
                      tag_impression(['side', 'position', 'position1', 'longs', 'width', 'height', 'tumorDiameter',
                        'type'],
                        item.impression) }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="2" label-width="0">
                  <el-form-item label-width="0"><el-button
                      @click="impressPublic('CTA_MRA_DSA_dialog', item.impression, index); Ult_CTA_MRA_DSA = 'DSA'">选择</el-button></el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="动脉瘤数量">
                    <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{ item.aneurysmCount }}
                    </div>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="9">
                  <el-form-item label="病因诊断">
                    <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{ item.pathogeny }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="2" label-width="0">
                  <el-form-item label-width="0"><el-button
                      @click="impressPublic('CTA_MRA_DSA_pathogeny_dialog', item.pathogeny, index); Ult_CTA_MRA_DSA = 'DSA'">选择</el-button></el-form-item>
                </el-col>
              </el-row>
            </div>
            <el-row>
              <!-- 颈部血管 -->
              <el-row v-show="item.checkPoint == '颈部血管'">
                <el-col :span="9">
                  <el-form-item label="印象">
                    <div class="el-input__inner wid90" style="height: auto;min-height: 40px;">{{ tag_impression(['side',
                      'position', 'degreeStenosis'], item.impression) }}</div>
                  </el-form-item>
                </el-col>
                <el-col :span="2" label-width="0">
                  <el-form-item label-width="0"><el-button
                      @click="impressPublic('UCMD_dialog', item.impression, index); Ult_CTA_MRA_DSA = 'DSA'">选择</el-button></el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-col :span="8" style="position: relative;">
                    <el-form-item label="图片">
                      <el-image :src="item.imgUrl" alt="" :preview-src-list="[item.imgUrl]" class="showImgStyle"
                        style="height: 100%;  vertical-align: bottom;" @click.stop="handleClick">
                        <div slot="placeholder" class="image-slot ml-10">
                          加载中<span class="dot">...</span>
                        </div>
                      </el-image>
                      <el-upload class="modifyImgBtn" action="#" list-type="text"
                        :on-change="(res, file) => { imgModify(res, file, item) }" :auto-upload="false"
                        :show-file-list="false">
                        <el-button size="small">点击上传</el-button>
                      </el-upload>
                    </el-form-item>
                  </el-col>
                </el-col>
                <el-col :span="18">
                  <el-form-item label="备注" prop="remark">
                    <el-input v-model="item.remark" placeholder="请输入备注" />
                  </el-form-item>
                </el-col>
                <el-col :span="24"><el-divider /></el-col>
              </el-row>
            </el-row>
          </div>
        </el-card>
      </div>
      <!-- DSA-End -->

    </el-form>

    <!-- <div v-for="(item, index) in accessory_examination" id="vs" :key="index" class="tab-pane smtz">
			<el-card shadow="never">
			</el-card>
		</div> -->

    <!-- 弹窗组 -->
    <div id="dialog-group">
      <!-- 心电图 -心电印象 -->
      <el-dialog title="心电印象" :visible.sync="ECG_impression_dialog" append-to-body>
        <span v-if="ecgModel.length > 0">
          <span v-if="ecgModel[0].type == '1'">
            <el-radio-group v-model="ECG_pop_data.impression" class="impress-btn-group" size="small">
              <el-radio v-for="(item, index) in ecgModel" :key="'ecg' + index" :label="item.name" border>{{ item.name
                }}</el-radio>
            </el-radio-group>
          </span>
          <span v-if="ecgModel[0].type == '2'">
            <el-checkbox-group v-model="ECG_pop_data.impression" class="impress-btn-group" size="small">
              <el-checkbox v-for="(item, index) in ecgModel" :key="'ecg' + index" :label="item.index" border>{{
                item.name
              }}</el-checkbox>
            </el-checkbox-group>
          </span>
        </span>
        <span v-else>
          <b>未获取到印象模板</b>
        </span>
        <!-- <el-radio-group v-model="ECG_pop_data.impression" class="impress-btn-group" size="small">
          <el-radio label="房颤" border />
          <el-radio label="房扑" border />
          <el-radio label="左室肥厚" border />
          <el-radio label="病理性 Q 波" border />
          <el-radio label="心肌缺血改变" border />
          <el-radio label="急性心肌梗死" border />
        </el-radio-group> -->
        <div slot="footer" class="dialog-footer">
          <el-button @click="ECG_impression_dialog = false">取 消</el-button>
          <el-button type="primary" @click="impressSave('ECG_list', 'ECG_impression_dialog')">确 定</el-button>
        </div>
      </el-dialog>
      <!-- 心电图-心电印象-End -->
      <!-- CT -CT印象 MRI-CT印象-->
      <el-dialog title="CT印象" :visible.sync="CT_impression_dialog" append-to-body>
        <el-form class="demo-form-inline">
          <!-- <el-input v-model="val" type="textarea" resize="none" /> -->
          <div class="el-textarea__inner el-textarea el-input--medium mb-10" style="min-height: 100px;">
            <el-tag v-for="(tag, index) in CT_impressionPop.tagList" :key="'CT印象' + index" closable
              :disable-transitions="true" class="mr-10 mb-10" @close="tagClose('CT_impressionPop', tag)">
              {{ tag }}
            </el-tag>
          </div>
          <el-form-item label="侧别">
            <el-radio-group v-model="CT_impressionPop.side">
              <el-radio label="左侧" />
              <el-radio label="右侧" />
            </el-radio-group>
          </el-form-item>
          <el-form-item label="出血部位" required>
            <el-radio-group v-model="CT_impressionPop.position">
              <el-radio label="基底节区" />
              <el-radio label="幕上脑干" />
              <el-radio label="小脑" />
              <el-radio label="脑干" />
              <el-radio label="脑室" />
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="CT_impressionPop.position !== '脑室'" label="出血大小" required>
            <el-input v-model="CT_impressionPop.degreeStenosis" placeholder="请输入内容" class="wid90">
              <template slot="append">
                ml
              </template>
            </el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="CT_impression_dialog = false">取 消</el-button>
          <el-button type="success" @click="tagAdd('CT_impressionPop', 'CT_impression_add_data')">新 增</el-button>
          <el-button v-if="ct_or_mri == 'ct'" type="primary" @click="impressSave('CT_list', 'CT_impression_dialog')">确
            定</el-button>
          <el-button v-else type="primary" @click="impressSave('MRI_list', 'CT_impression_dialog')">确 定</el-button>
        </div>
      </el-dialog>
      <!-- CT-CT印象 MRI-CT印象-End -->
      <!-- CT -CT报告 -->
      <el-dialog title="CT报告" :visible.sync="CT_reportcontent_dialog" append-to-body>
        <el-radio-group v-model="CT_reportcontentPop.reportcontent" class="impress-btn-group" size="small">
          <el-radio label="未见异常" border />
          <el-radio label="脑出血" border />
          <el-radio label="新发梗死灶" border />
          <el-radio label="陈旧性梗死灶" border />
          <el-radio label="其他" border />
        </el-radio-group>
        <div slot="footer" class="dialog-footer">
          <el-button @click="CT_reportcontent_dialog = false">取 消</el-button>
          <el-button v-if="ct_or_mri == 'ct'" type="primary"
            @click="impressSave('CT_list', 'CT_reportcontent_dialog')">确
            定</el-button>
          <el-button v-else type="primary" @click="impressSave('MRI_list', 'CT_reportcontent_dialog')">确 定</el-button>
        </div>
      </el-dialog>
      <!-- CT-CT报告-End -->

      <!-- CTA_MRA_DSA- 病因诊断 -->
      <el-dialog title="病因诊断" :visible.sync="CTA_MRA_DSA_pathogeny_dialog" append-to-body>
        <el-radio-group v-model="pathogenyPop.pathogeny" class="impress-btn-group" size="small">
          <el-radio label="高血压" border />
          <el-radio label="动静脉畸形AVM" border />
          <el-radio label="烟雾病" border />
          <el-radio label="血管淀粉样变性" border />
          <el-radio label="颅内动脉瘤" border />
          <el-radio label="硬脑膜动静脉瘘" border />
          <el-radio label="海绵状血管瘤" border />
          <el-radio label="颅内静脉窦血栓形成" border />
          <el-radio label="其他" border />
        </el-radio-group>
        <div slot="footer" class="dialog-footer">
          <el-button @click="CTA_MRA_DSA_pathogeny_dialog = false; pathogenyPop.pathogeny = ''">取 消</el-button>
          <el-button v-if="Ult_CTA_MRA_DSA == 'CTA'" type="primary"
            @click="impressSave('CTA_list', 'CTA_MRA_DSA_pathogeny_dialog')">确 定</el-button>
          <el-button v-if="Ult_CTA_MRA_DSA == 'MRA'" type="primary"
            @click="impressSave('MRA_list', 'CTA_MRA_DSA_pathogeny_dialog')">确 定</el-button>
          <el-button v-if="Ult_CTA_MRA_DSA == 'DSA'" type="primary"
            @click="impressSave('DSA_list', 'CTA_MRA_DSA_pathogeny_dialog')">确 定</el-button>

        </div>
      </el-dialog>
      <!-- CTA_MRA_DSA- 病因诊断-End -->

      <!-- CT -ASPECT报告 -->
      <el-dialog title="ASPECT评分" :visible.sync="CT_aspect_dialog" append-to-body>
        <el-row>
          <el-col :span="24">
            <div style="color: #3997FB;" class="mb-10">皮层下结构区域</div>
          </el-col>
          <el-col :span="24">
            <el-checkbox-group v-model="CT_aspectPop.aspectList" class="impress-btn-group" size="medium"
              @change="CT_aspectPop.score = 14 - CT_aspectPop.aspectList.length">
              <el-checkbox label="尾状核 (C)" border />
              <el-checkbox label="豆状核 (L)" border />
              <el-checkbox label="内囊 (IC)" border />
            </el-checkbox-group>
          </el-col>
          <el-col :span="24" class="mb-10">
            <div style="color: #3997FB;">大脑中动脉皮层</div>
          </el-col>
          <el-col :span="24">
            <el-checkbox-group v-model="CT_aspectPop.aspectList" class="impress-btn-group" size="medium"
              @change="CT_aspectPop.score = 14 - CT_aspectPop.aspectList.length">
              <el-checkbox label="大脑中动脉前皮质区(M1)" border />
              <el-checkbox label="岛叶皮质(I)" border />
              <el-checkbox label="大脑中动脉岛叶外侧皮质区(M2)" border />
              <el-checkbox label="大脑中动脉后皮层区(M3)" border />
              <el-checkbox label="M1上方的大脑中动脉皮层(M4)" border />
              <el-checkbox label="M2上方的大脑中动脉皮层(M5)" border />
              <el-checkbox label="M3上方的大脑中动脉皮层(M6)" border />
              <el-checkbox label="大脑前动脉区(A)" border />
              <el-checkbox label="大脑后动脉区(P)" border />
              <el-checkbox label="脑干区,包括延髓，桥脑和中脑(Po)" border />
              <el-checkbox label="小脑区，包括小脑半球、蚓部(Cb)" border />
            </el-checkbox-group>
          </el-col>
          <el-col :span="6" class="labelHeight">ASPECT评分结果</el-col>
          <el-col :span="15">
            <el-input v-model="CT_aspectPop.score" placeholder="请输入内容" disabled>
              <template slot="append">
                分
              </template>
            </el-input>
          </el-col>
        </el-row>
        <div slot="footer" class="dialog-footer clearBoth mt-10">
          <el-button @click="CT_aspect_dialog = false">取 消</el-button>
          <el-button v-if="ct_or_mri == 'ct'" type="primary" @click="impressSave('CT_list', 'CT_aspect_dialog')">确
            定</el-button>
          <el-button v-else type="primary" @click="impressSave('CT_list', 'CT_aspect_dialog')">确 定</el-button>
        </div>
      </el-dialog>
      <!-- CT - ASPECT报告-End -->
      <!-- CT PC-ASPECT报告 -->
      <el-dialog title="PC-ASPECT评分" :visible.sync="CT_PC_aspect_dialog" append-to-body>
        <el-row>
          <el-col :span="24">
            <div style="color: #3997FB;" class="mb-10">减2分区域</div>
          </el-col>
          <el-col :span="24">
            <el-checkbox-group v-model="CT_PC_aspectPop.aspectList" class="impress-btn-group" size="medium"
              @change="changePCAspect(CT_PC_aspectPop.aspectList)">
              <el-checkbox label="中脑" border />
              <el-checkbox label="桥脑" border />
            </el-checkbox-group>
          </el-col>
          <el-col :span="24" class="mb-10">
            <div style="color: #3997FB;">减一分区域</div>
          </el-col>
          <el-col :span="24">
            <el-checkbox-group v-model="CT_PC_aspectPop.aspectList" class="impress-btn-group" size="medium"
              @change="changePCAspect(CT_PC_aspectPop.aspectList)">
              <el-checkbox label="左侧丘脑" border />
              <el-checkbox label="右侧丘脑" border />
              <el-checkbox label="左侧小脑" border />
              <el-checkbox label="右侧小脑" border />
              <el-checkbox label="左大脑后动脉供血区" border />
              <el-checkbox label="右大脑后动脉供血区" border />
            </el-checkbox-group>
          </el-col>
          <el-col :span="6" class="labelHeight">PC-ASPECT评分结果</el-col>
          <el-col :span="15">
            <el-input v-model="CT_PC_aspectPop.score" placeholder="请输入内容" disabled>
              <template slot="append">
                分
              </template>
            </el-input>
          </el-col>
        </el-row>
        <div slot="footer" class="dialog-footer clearBoth mt-10">
          <el-button @click="CT_PC_aspect_dialog = false">取 消</el-button>
          <el-button v-if="ct_or_mri == 'ct'" type="primary" @click="impressSave('CT_list', 'CT_PC_aspect_dialog')">确
            定</el-button>
          <el-button v-else type="primary" @click="impressSave('CT_list', 'CT_PC_aspect_dialog')">确 定</el-button>
        </div>
      </el-dialog>
      <!-- CT PC-ASPECT报告-End -->
      <!--超声-印象 -->
      <el-dialog title="选择印象" :visible.sync="UCMD_dialog" append-to-body>
        <el-form class="demo-form-inline">
          <!-- <el-input v-model="val" type="textarea" resize="none" /> -->
          <div class="el-textarea__inner el-textarea el-input--medium mb-10" style="min-height: 100px;">
            <el-tag v-for="(tag, index) in UltrasoundPop.tagList" :key="'选择印象' + index" closable
              :disable-transitions="true" class="mr-10 mb-10" @close="tagClose('UltrasoundPop', tag)">
              {{ tag }}
            </el-tag>
          </div>
          <el-form-item label="侧别">
            <el-radio-group v-model="UltrasoundPop.side">
              <el-radio label="左侧" />
              <el-radio label="右侧" />
            </el-radio-group>
          </el-form-item>
          <el-form-item label="部位">
            <el-radio-group v-model="UltrasoundPop.position">
              <el-radio label="颈总" />
              <el-radio label="球部" />
              <el-radio label="颈内" />
              <el-radio label="锁骨下动脉" />
              <el-radio label="椎动脉" />
            </el-radio-group>
          </el-form-item>
          <el-form-item label="狭窄程度">
            <el-radio-group v-model="UltrasoundPop.degreeStenosis">
              <el-radio label="≤50%" />
              <el-radio label="50-69%" />
              <el-radio label="70-99%" />
              <el-radio label="闭塞" />
            </el-radio-group>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="UCMD_dialog = false">取 消</el-button>
          <el-button type="success" @click="tagAdd('UltrasoundPop', 'Ultrasound_add_data')">新 增</el-button>
          <el-button v-if="Ult_CTA_MRA_DSA == 'Ult'" type="primary"
            @click="impressSave('Ultrasound_list', 'UCMD_dialog')">确
            定</el-button>
          <el-button v-if="Ult_CTA_MRA_DSA == 'CTA'" type="primary" @click="impressSave('CTA_list', 'UCMD_dialog')">确
            定</el-button>
          <el-button v-if="Ult_CTA_MRA_DSA == 'MRA'" type="primary" @click="impressSave('MRA_list', 'UCMD_dialog')">确
            定</el-button>
          <el-button v-if="Ult_CTA_MRA_DSA == 'DSA'" type="primary" @click="impressSave('DSA_list', 'UCMD_dialog')">确
            定</el-button>
        </div>
      </el-dialog>
      <!-- 超声-印象-End -->

      <!--CTA_MRA_DSA 颅内血管-印象 -->
      <el-dialog title="选择印象" :visible.sync="CTA_MRA_DSA_dialog" append-to-body>
        <el-form class="demo-form-inline">
          <!-- <el-input v-model="val" type="textarea" resize="none" /> -->
          <div class="el-textarea__inner el-textarea el-input--medium mb-10" style="min-height: 100px;">
            <el-tag v-for="(tag, index) in CTA_MRA_DSA_Pop.tagList" :key="'选择印象2' + index" closable
              :disable-transitions="true" class="mr-10 mb-10" @close="tagClose('CTA_MRA_DSA_Pop', tag)">
              {{ tag }}
            </el-tag>
          </div>
          <el-form-item label="侧别">
            <el-radio-group v-model="CTA_MRA_DSA_Pop.side">
              <el-radio label="左侧" />
              <el-radio label="右侧" />
            </el-radio-group>
          </el-form-item>
          <el-form-item label="部位">
            <el-select v-model="CTA_MRA_DSA_Pop.position" placeholder="请选择">
              <el-option label="颈内动脉 ICA" value="颈内动脉 ICA" />
              <el-option label="后交通动脉 PComA" value="后交通动脉 PComA" />
              <el-option label="脉络膜前动脉 AChA" value="脉络膜前动脉 AChA" />
              <el-option label="大脑前动脉 ACA" value="大脑前动脉 ACA" />
              <el-option label="前交通动脉 AcomA" value="前交通动脉 AcomA" />
              <el-option label="大脑中动脉 MCA" value="大脑中动脉 MCA" />
              <el-option label="椎动脉 VA" value="椎动脉 VA" />
              <el-option label="基底动脉 BA" value="基底动脉 BA" />
              <el-option label="大脑后动脉 PCA" value="大脑后动脉 PCA" />
              <el-option label="小脑前下动脉 AICA" value="小脑前下动脉 AICA" />
              <el-option label="小脑后下动脉 PICA" value="小脑后下动脉 PICA" />
              <el-option label="小脑上动脉 SCA" value="小脑上动脉 SCA" />
            </el-select>
          </el-form-item>
          <el-form-item v-if="CTA_MRA_DSA_Pop.position == '颈内动脉 ICA'" label=" ">
            <el-radio-group v-model="CTA_MRA_DSA_Pop.position1">
              <el-radio label="ICA-颈段" />
              <el-radio label="ICA-岩段" />
              <el-radio label="ICA-破裂孔段" />
              <el-radio label="ICA-海绵窦段" />
              <el-radio label="ICA-床突段" />
              <el-radio label="ICA-眼动脉段" />
              <el-radio label="ICA-交通动脉段" />
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="CTA_MRA_DSA_Pop.position == '大脑前动脉 ACA'" label=" ">
            <el-radio-group v-model="CTA_MRA_DSA_Pop.position1">
              <el-radio label="A1" />
              <el-radio label="A2" />
              <el-radio label="A3" />
              <el-radio label="A4" />
              <el-radio label="A5" />
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="CTA_MRA_DSA_Pop.position == '椎动脉 VA'" label=" ">
            <el-radio-group v-model="CTA_MRA_DSA_Pop.position1">
              <el-radio label="M1" />
              <el-radio label="M2" />
              <el-radio label="M3" />
              <el-radio label="M4" />
              <el-radio label="M5" />
              <el-radio label="大脑中动脉 M2 分叉处" />
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="CTA_MRA_DSA_Pop.position == '大脑中动脉 MCA'" label=" ">
            <el-radio-group v-model="CTA_MRA_DSA_Pop.position1">
              <el-radio label="V1" />
              <el-radio label="V2" />
              <el-radio label="V3" />
              <el-radio label="V4" />
              <el-radio label="V5" />
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="CTA_MRA_DSA_Pop.position == '基底动脉 BA'" label=" ">
            <el-radio-group v-model="CTA_MRA_DSA_Pop.position1">
              <el-radio label="BA-顶端" />
              <el-radio label="BA-主干" />
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="CTA_MRA_DSA_Pop.position == '大脑后动脉 PCA'" label=" ">
            <el-radio-group v-model="CTA_MRA_DSA_Pop.position1">
              <el-radio label="P1" />
              <el-radio label="P2" />
              <el-radio label="P3" />
              <el-radio label="P4" />
            </el-radio-group>
          </el-form-item>
          <el-row>
            <el-form-item label="大小">
              <el-col :span="10">
                <el-input v-model="CTA_MRA_DSA_Pop.longs" placeholder="请输入内容">
                  <template slot="prepend">长</template>
                  <template slot="append">mm</template>
                </el-input>
              </el-col>
              <el-col :span="10" :offset="1">
                <el-input v-model="CTA_MRA_DSA_Pop.width" placeholder="请输入内容">
                  <template slot="prepend">宽</template>
                  <template slot="append">mm</template>
                </el-input>
              </el-col>
            </el-form-item>
            <el-form-item label=" " label-width="40px">
              <el-col :span="11">
                <el-input v-model="CTA_MRA_DSA_Pop.height" placeholder="请输入内容">
                  <template slot="prepend">高</template>
                  <template slot="append">mm</template>
                </el-input>
              </el-col>
              <el-col :span="11" :offset="1">
                <el-input v-model="CTA_MRA_DSA_Pop.tumorDiameter" placeholder="请输入内容">
                  <template slot="prepend">瘤径</template>
                  <template slot="append">mm</template>
                </el-input>
              </el-col>
            </el-form-item>
          </el-row>
          <el-form-item label="类型">
            <el-radio-group v-model="CTA_MRA_DSA_Pop.type">
              <el-radio label="梭形" />
              <el-radio label="囊状" />
              <el-radio label="夹层" />
              <el-radio label="假性动脉瘤" />
            </el-radio-group>
          </el-form-item>
        </el-form>
        <!--
        'side': '侧别', // 侧别
        'position': '部位', // 部位
        'position1': '部位', // 具体部位(可选)
        'longs': '长', // 长
        'width': '宽', // 宽
        'height': '高', // 高
        'tumorDiameter': '瘤径', // 瘤径
        'type': '类型', // 类型
        -->
        <div slot="footer" class="dialog-footer">
          <el-button @click="CTA_MRA_DSA_dialog = false">取 消</el-button>
          <el-button type="success" @click="tagAdd('CTA_MRA_DSA_Pop', 'CTA_MRA_DSA_add_data')">新 增</el-button>
          <el-button v-if="Ult_CTA_MRA_DSA == 'CTA'" type="primary"
            @click="impressSave('CTA_list', 'CTA_MRA_DSA_dialog')">确
            定</el-button>
          <el-button v-if="Ult_CTA_MRA_DSA == 'MRA'" type="primary"
            @click="impressSave('MRA_list', 'CTA_MRA_DSA_dialog')">确
            定</el-button>
          <el-button v-if="Ult_CTA_MRA_DSA == 'DSA'" type="primary"
            @click="impressSave('DSA_list', 'CTA_MRA_DSA_dialog')">确
            定</el-button>
        </div>
      </el-dialog>
      <!-- CTA_MRA_DSA 颅内血管-印象-End -->
    </div>
  </div>
</template>

<script>
import { queryAEPost, saveCheckups, getEcgImage, findImpressionClass,getImage } from '@/api/green-channel/tab-request'

export default {
  // 由主页面(父组件) 接收来的, 选择项的数据
  props: ['checkrowdata'], // 由主页面(父组件) 接收来的, 选择项的数据
  data() {
    return {
      dialogVisible: false, // 弹窗标识
      accessory_examination: [],
      /* dialog标识*/
      ECG_impression_dialog: false, //  心电图 - 印象
      CT_impression_dialog: false, //  CT - 印象
      CT_reportcontent_dialog: false, //  CT - 报告
      CT_aspect_dialog: false, //  CT - Aspect评分
      CT_PC_aspect_dialog: false, //  CT - PC-Aspect评分
      UCMD_dialog: false, //  超声 - 印象   //Ult CTA MRA DSA颈部公用
      MRI_dialog: false, //  MRI - 印象
      CTA_MRA_DSA_dialog: false, //  CTA_MRA_DSA公用 - 印象
      CTA_MRA_DSA_pathogeny_dialog: false, //  CTA_MRA_DSA公用 - 病因诊断

      /* 根据检查类型筛选数据*/
      ECG_list: [], // 心电图
      CT_list: [], // CT
      Ultrasound_list: [], // 超声
      MRI_list: [], // MRI
      CTA_list: [], // CTA
      DSA_list: [], // DSA
      MRA_list: [], // MRA
      /* 根据检查类型筛选数据-End*/

      /* 心电印象-弹窗数据*/
      ECG_pop_data: {
        impression: '' // 心电图弹窗 -心电印象
      },
      /* 心电印象-弹窗数据-End*/
      /* CT印象-弹窗数据*/
      CT_impressionPop: {
        side: '', // 侧别
        position: '', // 出血部位
        degreeStenosis: '', // 出血大小
        tagList: [] //
      },
      /* CT印象-弹窗数据-End*/
      /* CT报告-弹窗数据*/
      CT_reportcontentPop: {// CT弹窗 -CT报告
        reportcontent: ''
      },
      /* CT报告-弹窗数据-End*/
      /* CT报告-aspect数据*/
      CT_aspectPop: {
        aspectList: [],
        score: 14
      },
      /* CT报告-aspect数据-End*/

      /* CT报告-PC-aspect数据*/
      CT_PC_aspectPop: {
        aspectList: [],
        score: 10
      },
      /* CT报告-PC-aspect数据-End*/


      /* 超声-印象*/
      UltrasoundPop: {
        side: '', // 侧别
        position: '', // 部位
        degreeStenosis: '', // 狭窄程度
        tagList: [] //
      },
      /* 超声-印象-End*/
      /* CTA_MRA_DSA 颅内血管-印象*/
      CTA_MRA_DSA_Pop: {
        'side': '', // 侧别
        'position': '', // 部位
        'position1': '', // 具体部位(可选)
        'type': '', // 类型
        'longs': '', // 长
        'width': '', // 宽
        'height': '', // 高
        'tumorDiameter': '', // 瘤径
        tagList: [] //
      },
      /* CTA_MRA_DSA 颅内血管-印象-End*/
      /* 病因诊断*/
      pathogenyPop: {
        pathogeny: ''
      },
      /* 病因诊断-End*/

      publicIndex: '', // 当前修改数据元素下标
      dynamicTags: [], // tag 动态 list

      CT_impression_add_data: { // CT印象 表单信息模板
        'leftRight': '侧别',
        'bleedingSite': '出血部位',
        'bleedingSize': '出血大小'
      },
      Ultrasound_add_data: { // 超声印象表单信息模板
        'side': '侧别',
        'position': '部位',
        'degreeStenosis': '狭窄程度'
      },
      CTA_MRA_DSA_add_data: {
        'side': '侧别', // 侧别
        'position': '部位', // 部位
        'position1': '部位', // 具体部位(可选)
        'longs': '长', // 长
        'width': '宽', // 宽
        'height': '高', // 高
        'tumorDiameter': '瘤径', // 瘤径
        'type': '类型' // 类型
      },
      ct_or_mri: '', // CT MRI 通用切换
      Ult_CTA_MRA_DSA: '', // 超声或CTA或MRA或DSA 通用切换

      newExamine: { // 新增数据
        // image: (binary)
        id: '',
        image: null,
        userId: this.$store.getters.userId,
        dispatchId: this.checkrowdata.dispatchId,
        medicalId: this.checkrowdata.medicalId,
        // imgurl: '',
        impression: '', // （印象）
        uploadTime: '', // （图片上传时间 ）
        inspectionType: '', // （检查类型 例如心电图 超声）
        diagnosticTime: '', // （心电图确诊时间）
        openerTime: '', // （开具单据时间）
        checkPoint: '', // 检查部位
        pathogeny: '', // （病因诊断）
        aspectScore: '', // （ASPECT评分）
        pc_aspectScore: '', // （PC-ASPECT评分）
        informtime: '', // （通知CT室/超生室时间）
        poisetime: '', // （CT室完成准备时间）
        reporttime: '', // （报告时间）
        reportcontent: '', // （报告内容）
        checkendtime: '', // （检查结束时间）
        aneurysmCount: '', // （动脉瘤数量）
        remark: '' // （备注）
      },
      requireArray: [],
      ecgModel: [],
      ecgMap: {}

      // dusModel: []

    }
  },
  computed: {},
  updated() { },
  created() {
    this.findImpressionClassFun()
  },
  mounted() {
    // console.log(this.checkrowdata.diagnoseContent)

    if (this.checkrowdata.diagnoseContent.indexOf('颅内动脉瘤') !== -1) {
      this.requireArray.push('CTA', 'MRA', 'DSA')
    }
    if (this.checkrowdata.diagnoseContent.indexOf('脑出血') !== -1) {
      this.requireArray.push('MRI', 'CTA', 'MRA', 'DSA')
    }
    if (this.checkrowdata.diagnoseContent.indexOf('颈动脉狭窄或闭塞') !== -1) {
      this.requireArray.push('超声', 'CTA', 'MRA', 'DSA')
    }
    // console.log(this.requireArray)
    // this.findcheckup()
  },
  methods: {
    handleClick() {
      this.$nextTick(() => {
        const div = document.getElementsByClassName('el-image-viewer__actions__inner')
        const i = document.createElement('i')
        i.className = 'close-icon el-icon-close'
        document.querySelector('.el-image-viewer__close').style.display = 'none'
        div[0].appendChild(i)
        i.addEventListener('click', () => {
          document.querySelector('.el-image-viewer__close').click()
        })
      })
    },
    ecgImpressionMap(val) {
      val = val || ''
      const data = Array.isArray(val) ? val : val.split(',')
      const arr = []
      data.forEach(item => {
        this.ecgMap[item] &&
          arr.push(this.ecgMap[item])
      })
      console.log(arr)
      return arr.join(',')
    },
    // 查询心电图模板
    findImpressionClassFun() {
      const data = {
        hospitalId: this.$store.getters.hospitalId,
        greenType: '卒中'
      }
      findImpressionClass(data).then(res => {
        if (res.code === 0) {
          // let ecg = []
          res.data.forEach(item => {
            if (item.name === '心电图') {
              // ecg = item.impressionclassbList
              this.ecgModel = item.impressionclassbList
            }
          })
          if (this.ecgModel[0] && this.ecgModel[0].type) {
            this.ECG_pop_data.impression = this.ecgModel[0].type === '1' ? '' : []
          }
          this.ecgModel.forEach(item => {
            this.ecgMap[item.index] = item.name
          })
          this.findcheckup()
          // console.table(this.ecgMap)
          // console.log(this.ecgMap)
        } else {
          this.$message.error('请求异常')
        }
      }).catch(err => {
        console.log(err)
      })
    },

    imgUpload(res, file) {
      const isJPG = res.raw.type === 'image/jpeg' || res.raw.type === 'image/png'
      const isLt5M = res.raw.size / 1024 / 1024 < 5
      if (!isJPG) {
        return this.$message.error('上传图片只能是 JPG 或 PNG 格式!')
      }
      if (!isLt5M) {
        return this.$message.error('上传图片大小不能超过 5MB!')
      }
      this.$set(this.newExamine, 'imgUrl', URL.createObjectURL(res.raw))
      this.newExamine.image = res.raw
    },
    imgModify(res, file, item) {
      const isJPG = res.raw.type === 'image/jpeg' || res.raw.type === 'image/png'
      const isLt5M = res.raw.size / 1024 / 1024 < 5
      if (!isJPG) {
        return this.$message.error('上传图片只能是 JPG 或 PNG 格式!')
      }
      if (!isLt5M) {
        return this.$message.error('上传图片大小不能超过 5MB!')
      }
      item.image = res.raw
      item.imgUrl = URL.createObjectURL(res.raw)
    },

    /*
      * 获取心电图机数据,成功后重新查询页面
    */
    getElectrocardiograph() {
      getEcgImage(this.checkrowdata.patientId).then(res => {
        if (res.code !== 9999) {
          if (res.data.status === 1) {
            this.findcheckup()
          } else {
            this.$message.info('无可获取的心电图数据')
          }
        } else {
          this.$message.error('获取失败')
        }
      }
      )
    },

    saveCheck(data) {
      if (this.newExamine.uploadTime && this.newExamine.checkendtime) {
        if (new Date(this.newExamine.uploadTime).getTime() > new Date(this.newExamine.checkendtime).getTime()) {
          this.$message.warning(`检查开始时间不能大于检查结束时间！`)
          return
        }
      }
      if (this.newExamine.checkendtime && this.newExamine.reporttime) {
        if (new Date(this.newExamine.checkendtime).getTime() > new Date(this.newExamine.reporttime).getTime()) {
          this.$message.warning(`检查结束时间不能大于报告完成时间！`)
          return
        }
      }
      if (this.newExamine.uploadTime && this.newExamine.reporttime) {
        if (new Date(this.newExamine.uploadTime).getTime() > new Date(this.newExamine.reporttime).getTime()) {
          this.$message.warning(`检查开始时间不能大于报告完成时间！`)
          return
        }
      }

      // const data = this.newExamine
      let tips = false
      if (!data.inspectionType) {
        tips = '检查类型'
      } else if (!data.openerTime) {
        tips = '开具单据时间'
      } else if (!data.uploadTime) {
        tips = '检查开始时间'
      } else if (!data.reporttime && data.inspectionType !== 'MRI') {
        tips = '报告完成时间'
      } else {
        switch (data.inspectionType) {
          case '心电图':
            if (!data.impression) {
              tips = '心电印象'
            }
            break
          case 'CT':
            if (!data.checkendtime) {
              tips = 'CT检查结束时间'
            } else if (!data.reporttime) {
              tips = 'CT报告时间'
            }
            break
          case '超声':
            if (!data.impression) {
              tips = '印象'
            }
            break
          case 'MRI':
            if (!data.checkendtime) {
              // tips = 'CT检查结束时间'
            } else if (!data.reporttime) {
              // tips = '报告时间'
            } else if (!data.impression) {
              tips = '印象'
            } else if (!data.reportcontent) {
              // tips = 'CT报告'
            } else if (!data.aspectScore) {
              // tips = 'ASPECT评分'
            }
            break
          default:
            if (['CTA', 'MRA', 'DSA'].includes(data.inspectionType)) {
              if (!data.checkPoint) {
                tips = '检查部位'
              } else if (data.checkPoint === '颈部血管') {
                if (!data.impression) {
                  tips = '印象'
                }
              } else if (data.checkPoint === '颅内血管') {
                if (!data.impression) {
                  tips = '印象'
                } else if (!data.aneurysmCount) {
                  tips = '动脉瘤数量'
                } else if (!data.pathogeny) {
                  tips = '病因诊断'
                }
              }
            }
        }
        if (!data.image && !data.imgUrl) {
          tips = '检查图片'
        }
      }
      if (tips) {
        this.$message.warning(tips + '不能为空')
        return
      }
      // console.log(data, !data.image, tips)
      this.saveCheckup(data)
    },

    /*
      * 保存修改
    */
    saveCheckup(saveData) {
      const formData = new FormData()
      let tempFile
      // console.log(saveData.image)
      if (saveData.image) {
        tempFile = saveData.image
        formData.append('image', tempFile)
      } else {
        /* 修改时，若图片未更新，额外增加 'imgurl'字段，'image'传空文件*/
        // tempFile = new File([' '], 'template.jpg')
        // formData.append('imgurl', saveData.imgUrl)
        // formData.append('image', tempFile)
      }
      formData.append('id', saveData.id)
      formData.append('userId', parseInt(this.$store.getters.userId))
      formData.append('dispatchId', saveData.dispatchId)
      formData.append('medicalId', saveData.medicalId)
      formData.append('impression', saveData.impression)
      formData.append('uploadTime', saveData.uploadTime)
      formData.append('inspectionType', saveData.inspectionType)
      // formData.append('diagnosticTime', saveData.diagnosticTime)
      // app逻辑:reporttime与diagnosticTime值相同
      formData.append('diagnosticTime', saveData.reporttime)
      formData.append('openerTime', saveData.openerTime)
      formData.append('checkPoint', saveData.checkPoint)
      // 
      formData.append('aspectScore', saveData.aspectScore)
      formData.append('informtime', saveData.informtime)
      formData.append('poisetime', saveData.poisetime)
      formData.append('reporttime', saveData.reporttime)
      formData.append('reportcontent', saveData.reportcontent)
      formData.append('checkendtime', saveData.checkendtime)
      formData.append('aneurysmCount', saveData.aneurysmCount)
      formData.append('remark', saveData.remark)
      if (saveData.pc_aspectScore) {
        formData.append('pathogeny', saveData.pc_aspectScore)
      } else {
        formData.append('pathogeny', saveData.pathogeny)
      }
      // console.log("saveData",saveData)
      // return 
      saveCheckups(formData).then(res => {
        const tips = this.dialogVisible ? '新增' : '保存'
        if (res.code === 0) {
          this.$message.success(tips + '成功')
          this.findcheckup()
          if (this.dialogVisible) {
            this.resetAddForm()
          }
          this.dialogVisible = false
        } else {
          this.$message.warning(tips + '失败')
        }
      })
    },

    resetAddForm() {
      this.newExamine = { // 新增数据
        id: '',
        image: null,
        userId: this.$store.getters.userId,
        dispatchId: this.checkrowdata.dispatchId,
        medicalId: this.checkrowdata.medicalId,
        // imgurl: '',
        impression: '', // （印象）
        uploadTime: '', // （图片上传时间 ）
        inspectionType: '', // （检查类型 例如心电图 超声）
        diagnosticTime: '', // （心电图确诊时间）
        openerTime: '', // （开具单据时间）
        checkPoint: '', // 检查部位
        pathogeny: '', // （病因诊断）
        aspectScore: '', // （ASPECT评分）
        informtime: '', // （通知CT室/超生室时间）
        poisetime: '', // （CT室完成准备时间）
        reporttime: '', // （报告时间）
        reportcontent: '', // （报告内容）
        checkendtime: '', // （检查结束时间）
        aneurysmCount: '', // （动脉瘤数量）
        remark: '' // （备注）
      }
    },
    /*
      * tag关闭
      * popName : 弹出表单数据名
      * tag :  当前选中关闭tag
    */
    tagClose(popName, tag) { //    tag标签x按钮
      const that = this
      that[popName].tagList.splice(that[popName].tagList.indexOf(tag), 1)
      // if (dialogName === 'CT_impression_dialog') {
      //   this.CT_impressionPop.tagList.splice(this.CT_impressionPop.tagList.indexOf(tag), 1)
      // } else if (dialogName === 'UCMD_dialog') {
      //   this.UltrasoundPop.tagList.splice(this.UltrasoundPop.tagList.indexOf(tag), 1)
      // }
    },

    /*
      * tag新增
      * popName : 弹出表单数据名
      * templateName :  弹出表单信息模板
    */
    tagAdd(popName, templateName) {
      if (popName == 'CT_impressionPop' && !this.requiredCheck()) {
        return
      }
      // 'XX_impressionPop', 'XX_impression_add_data'
      const that = this
      // const msg = ''
      let tagInfo = ''
      for (const ele in that[templateName]) {
        if (that[popName][ele] === '') {
          if (ele === 'position1' || ele === 'side') { // CTA MRA DSA 专用
            const position = that[popName]['position']
            // if (position === '后交通动脉 PComA' || position === '脉络膜前动脉 AChA' || position === '前交通动脉 AcomA' || position === '小脑前下动脉 AICA' || position === '小脑后下动脉 PICA' || position === '小脑上动脉 SCA') {
            if (['后交通动脉 PComA', '脉络膜前动脉 AChA', '前交通动脉 AcomA', '小脑前下动脉 AICA', '小脑后下动脉 PICA', '小脑上动脉 SCA'].includes(position)) {
              continue
            }
          }
          if (that.CT_impressionPop.bleedingSite !== '脑室') {
            this.$message.warning(`${that[templateName][ele]}不能为空`)
            return false
          }
        } else {
          console.log("that[popName][ele]", that[popName][ele], popName, ele)
          if (ele === 'longs' || ele === 'width' || ele === 'height') {
            continue
          } else if (ele === 'tumorDiameter') {
            tagInfo += `${that[popName]['longs']}×${that[popName]['width']}×${that[popName]['height']}×${that[popName]['tumorDiameter']} ` //   //  注意是'×'(乘|叉), 不是X
          } else {
            tagInfo += that[popName][ele] + ' '
          }
        }
      }
      console.log("tagInfo", tagInfo)
      tagInfo = tagInfo.trim()
      if (that[popName].tagList.indexOf(tagInfo) > -1) { // 重复数据判断
        this.$message.warning(`该数据已存在`)
        return false
      } else {
        console.log(that[popName].tagList, tagInfo)
        that[popName].tagList.push(tagInfo)
        for (const ele in that[templateName]) { // 清空数据
          that[popName][ele] = ''
        }
      }
    },

    /*
     *   将传来的json串转格式为显示格式  ["侧别", "出血部位", "出血大小"]
     * arrList : 需要校验的字段名称拼成的数据
     * impression :  后台传来的json串
   */
    tag_impression(arrList, impression) {
      if (!!impression && impression.length > 2) {
        impression = JSON.parse(impression)
        const arr = []
        impression.forEach((item, index) => {
          let str = ''
          arrList.forEach((ele, subIndex) => {
            /* 颅内 印象 专用*/
            if (ele === 'position1' && !item[ele]) { // 部分二级部位为空
              return
            }
            if (ele === 'longs' || ele === 'width' || ele === 'height') {
              return
            } else if (ele === 'tumorDiameter') {
              str += `${item['longs']}×${item['width']}×${item['height']}×${item['tumorDiameter']}` //   //  注意是'×'(乘|叉), 不是X
              /* 颅内 印象 专用-End*/
            } else {
              str += item[ele]
            }
            if (subIndex !== arrList.length - 1) {
              str += ','
            }
          })
          arr.push(str.replace(',undefined', ''))
        })
        // str.pop() // 删除末尾逗号
        return '[' + arr.join('，') + ']'
      } else {
        return
      }
    },
    requiredCheck() {
      console.log(this.CT_impressionPop)
      if ((this.CT_impressionPop.bleedingSite == '' && this.CT_impressionPop.position == '') || (!this.CT_impressionPop.bleedingSite && !this.CT_impressionPop.position) || ((this.CT_impressionPop.bleedingSite && this.CT_impressionPop.bleedingSite.length == 0) && (this.CT_impressionPop.position && this.CT_impressionPop.position.length == 0))) {
        this.$message.warning('未选择出血部位')
        return
      }
      if (this.CT_impressionPop.bleedingSite !== '脑室' && ((this.CT_impressionPop.bleedingSize == '' && this.CT_impressionPop.degreeStenosis == '') || (!this.CT_impressionPop.bleedingSize && !this.CT_impressionPop.degreeStenosis) || ((this.CT_impressionPop.bleedingSize && this.CT_impressionPop.bleedingSize.length == 0) && (this.CT_impressionPop.degreeStenosis && this.CT_impressionPop.degreeStenosis.length == 0)))) {
        this.$message.warning('未填写出血大小')
        return
      }
      if (this.CT_impressionPop.bleedingSite) {
        this.CT_impressionPop.position = this.CT_impressionPop.bleedingSite
      } else if (this.CT_impressionPop.position) {
        this.CT_impressionPop.bleedingSite = this.CT_impressionPop.position
      }
      if (this.CT_impressionPop.bleedingSize) {
        this.CT_impressionPop.degreeStenosis = this.CT_impressionPop.bleedingSize
      } else if (this.CT_impressionPop.degreeStenosis) {
        this.CT_impressionPop.bleedingSize = this.CT_impressionPop.degreeStenosis
      }

      if (this.CT_impressionPop.side) {
        this.CT_impressionPop.leftRight = this.CT_impressionPop.side
      } else if (this.CT_impressionPop.leftRight) {
        this.CT_impressionPop.side = this.CT_impressionPop.leftRight
      }
      // if (this.CT_impressionPop.bleedingSite == '' || !this.CT_impressionPop.bleedingSite || this.CT_impressionPop.bleedingSite.length == 0) {
      //   this.$message.warning('未选择出血部位')
      //   return
      // }
      // if (this.CT_impressionPop.bleedingSite !== '脑室' && (this.CT_impressionPop.bleedingSize == '' || !this.CT_impressionPop.bleedingSize || this.CT_impressionPop.bleedingSize.length == 0)) {
      //   this.$message.warning('未填写出血大小')
      //   return
      // }
      return true
    },
    impressSave(listName, dialogName) { // 弹窗点击确定按钮后传值保存
      const that = this
      // console.log(this.ECG_pop_data, 'data')
      console.log(dialogName, 'dialogName')
      if (dialogName === 'ECG_impression_dialog') {
        /** ***************** 心电图 印象/*******************/
        if (this.dialogVisible) {
          this.newExamine.impression = this.ECG_pop_data.impression
        } else {
          that[listName][this.publicIndex].impression = this.ECG_pop_data.impression
        }
        // 根据类型赋空
        this.ECG_pop_data.impression = Array.isArray(this.ECG_pop_data.impression) ? [] : ''

        //* ****************** 心电图 印象-End/*******************/
      } else if (dialogName === 'CT_reportcontent_dialog') {
        //* ****************** CT报告 /*******************/
        if (this.dialogVisible) {
          this.newExamine.reportcontent = this.CT_reportcontentPop.reportcontent
        } else {
          that[listName][this.publicIndex].reportcontent = this.CT_reportcontentPop.reportcontent
        }
        this.CT_reportcontentPop.reportcontent = ''
        //* ****************** CT报告-End /*******************/
      } else if (dialogName === 'CT_impression_dialog') {
        //* ****************** CT 印象 /*******************/
        if (this.CT_impressionPop.tagList.length === 0) {
          that[dialogName] = false
          return false
        } else {
          const arr = []
          this.CT_impressionPop.tagList.forEach(item => {
            const [leftRight, bleedingSite, bleedingSize] = item.split(' ')
            arr.push({ bleedingSite: bleedingSite, bleedingSize: bleedingSize, degreeStenosis: '', height: '', leftRight: leftRight, longs: '', position: '', position1: '', side: '', tumorDiameter: '', type: '', width: '' })
          })

          if (this.dialogVisible) {
            this.newExamine.impression = JSON.stringify(arr)
          } else {
            that[listName][this.publicIndex].impression = JSON.stringify(arr)
          }
          // 清空
          this.CT_impressionPop = { leftRight: '', bleedingSite: '', bleedingSize: '', tagList: [] }
        }
        //* ****************** CT 印象-End /*******************/
      } else if (dialogName === 'CT_aspect_dialog') { // CT弹窗内- ASPECT评分
        //* ****************** ASPECT评分 /*******************/
        if (this.dialogVisible) {
          this.newExamine.aspectScore = this.CT_aspectPop.score + (this.CT_aspectPop.aspectList.length > 0 ? ";" + this.CT_aspectPop.aspectList.toString() : "")
        } else {
          that[listName][this.publicIndex].aspectScore = this.CT_aspectPop.score + (this.CT_aspectPop.aspectList.length > 0 ? ";" + this.CT_aspectPop.aspectList.toString() : "")
        }
        this.CT_aspectPop.aspectList = [] // 清空多选
        //* ****************** ASPECT评分-End /*******************/
      } else if (dialogName === 'CT_PC_aspect_dialog') { // CT弹窗内- ASPECT评分
        //* ****************** ASPECT评分 /*******************/
        console.log("this.dialogVisible", this.dialogVisible)
        if (this.dialogVisible) {
          this.newExamine.pc_aspectScore = this.CT_PC_aspectPop.score + (this.CT_PC_aspectPop.aspectList.length > 0 ? ";[" + this.CT_PC_aspectPop.aspectList.toString() + "]" : "")
        } else {
          that[listName][this.publicIndex].pathogeny = this.CT_PC_aspectPop.score + (this.CT_PC_aspectPop.aspectList.length > 0 ? ";" + this.CT_PC_aspectPop.aspectList.toString() : "")
        }
        this.CT_PC_aspectPop.aspectList = [] // 清空多选
        //* ****************** ASPECT评分-End /*******************/
      } else if (dialogName === 'UCMD_dialog') {
        //* ****************** 超声或CTA或MRA或DSA 通用(颈部血管) /*******************/
        if (this.UltrasoundPop.tagList.length === 0) {
          that[dialogName] = false
          return false
        } else {
          const arr = []
          this.UltrasoundPop.tagList.forEach(item => {
            const [side, position, degreeStenosis] = item.split(' ')
            arr.push({ 'bleedingSite': '', 'bleedingSize': '', 'degreeStenosis': degreeStenosis, 'height': '', 'leftRight': '', 'longs': '', 'position': position, 'position1': '', 'side': side, 'tumorDiameter': '', 'type': '', 'width': '' })
          })
          if (this.dialogVisible) {
            this.newExamine.impression = JSON.stringify(arr)
          } else {
            that[listName][this.publicIndex].impression = JSON.stringify(arr)
          }
          // 清空
          this.UltrasoundPop = { side: '', position: '', degreeStenosis: '', tagList: [] }
        }
        //* ****************** 超声或CTA或MRA或DSA 通用(颈部血管)-End /*******************/
      } else if (dialogName === 'CTA_MRA_DSA_dialog' || dialogName === 'CTA_MRA_DSA_dialog' || dialogName === 'CTA_MRA_DSA_dialog') {
        //* ******************  CTA_MRA_DSA 颅内血管-印象 /*******************/
        const arr = []
        this.CTA_MRA_DSA_Pop.tagList.forEach(item => {
          const result = item.split(' ')
          let side, positionZh, positionEn, position1, sizeArr, type
          side = positionZh = positionEn = position1 = sizeArr = type = ''
          if (result.length > 5) {
            [side, positionZh, positionEn, position1, sizeArr, type] = item.split(' ')
          } else {
            // position1 = ''
            [side, positionZh, positionEn, sizeArr, type] = item.split(' ')
          }
          const position = positionZh + ' ' + positionEn
          const [longs, width, height, tumorDiameter] = sizeArr.split('×') //  注意是'×'(乘|叉), 不是X
          arr.push({ 'bleedingSite': '', 'bleedingSize': '', 'degreeStenosis': '', 'height': height, 'leftRight': '', 'longs': longs, 'position': position, 'position1': position1, 'side': side, 'tumorDiameter': tumorDiameter, 'type': type, 'width': width })
        })

        if (this.dialogVisible) {
          this.newExamine.impression = JSON.stringify(arr)
          this.newExamine.aneurysmCount = arr.length
        } else {
          that[listName][this.publicIndex].impression = JSON.stringify(arr)
          that[listName][this.publicIndex].aneurysmCount = arr.length
        }
        this.CTA_MRA_DSA_Pop = { 'side': '', 'position': '', 'position1': '', 'type': '', 'longs': '', 'width': '', 'height': '', 'tumorDiameter': '', tagList: [] }
        //* ******************  CTA_MRA_DSA 颅内血管-印象-End /*******************/
      } else if (dialogName === 'CTA_MRA_DSA_pathogeny_dialog' || dialogName === 'CTA_MRA_DSA_pathogeny_dialog' || dialogName === 'CTA_MRA_DSA_pathogeny_dialog') {
        //* ****************************  病因诊断 /*******************/

        if (this.dialogVisible) {
          this.newExamine.pathogeny = this.pathogenyPop.pathogeny
        } else {
          that[listName][this.publicIndex].pathogeny = this.pathogenyPop.pathogeny
        }
        this.pathogenyPop.pathogeny = ''
        //* ****************************  病因诊断-End /*******************/
      }
      that[dialogName] = false
    },

    /*
      *   打开对应弹出框弹出框
      * listName : 筛选数据list名
      * impression :  弹出框回显数据, 暂未使用
      * index :  选中数据下标(公共)
    */
    impressPublic(listName, impression, index = undefined) {
      // 筛选数据list名,  impression印象值，  index
      const that = this
      that[listName] = true
      if (undefined !== index) {
        this.publicIndex = index
      }
      // this.val = impression.replace(/\[|]/g, '')     //暂不回显
    },

    /*
      *   辅助检查数据查询
    */
    findcheckup() {
      queryAEPost(this.checkrowdata.dispatchId).then(data => {
        // console.log('辅助检查数据', data)
        this.accessory_examination = data
        /* 根据检查类型筛选数据*/
        this.ECG_list = data.filter(ele => ele.inspectionType === '心电图')
        this.CT_list = data.filter(ele => ele.inspectionType === 'CT')
        this.Ultrasound_list = data.filter(ele => ele.inspectionType === '超声')
        this.MRI_list = data.filter(ele => ele.inspectionType === 'MRI')
        this.CTA_list = data.filter(ele => ele.inspectionType === 'CTA')
        this.DSA_list = data.filter(ele => ele.inspectionType === 'DSA')
        this.MRA_list = data.filter(ele => ele.inspectionType === 'MRA')
        /* 根据检查类型筛选数据-End*/
      })
    },

    beforeAvatarUpload(file) {
      // console.log(9999)
      // const isJPG = file.type === 'image/jpeg'
      // const isLt2M = file.size / 1024 / 1024 < 2
      // console.log(9999, isJPG, isLt2M)
      // if (!isJPG) {
      //   this.$message.error('上传头像图片只能是 JPG 格式!')
      // }
      // if (!isLt2M) {
      //   this.$message.error('上传头像图片大小不能超过 2MB!')
      // }
      // return isJPG && isLt2M
    },

    // 更改下拉时清空弹窗数据
    clearExamineform() {
      this.newExamine.impression = ''
      this.newExamine.uploadTime = ''
      this.newExamine.diagnosticTime = ''
      this.newExamine.openerTime = ''
      this.newExamine.checkPoint = ''
      this.newExamine.pathogeny = ''
      this.newExamine.aspectScore = ''
      this.newExamine.informtime = ''
      this.newExamine.poisetime = ''
      this.newExamine.reporttime = ''
      this.newExamine.reportcontent = ''
      this.newExamine.checkendtime = ''
      this.newExamine.aneurysmCount = ''
    },
    changePCAspect(val) {
      let _this = this
      _this.CT_PC_aspectPop.score = 10
      val.forEach(el => {
        if (el === "中脑" || el === "桥脑") {
          _this.CT_PC_aspectPop.score -= 2
        } else {
          _this.CT_PC_aspectPop.score -= 1
        }
      })
    }
  }
}
</script>

<style scoped>
.el-checkbox.is-bordered.el-checkbox--medium {
  margin-left: 10px;
}

.pageDateStyle {
  padding: 20px;
}

.AData {
  margin-left: 20px;
}

.dataTitleStyle {
  margin-bottom: 45px;
  line-height: 35px;
}

.impress-btn-group label {
  margin-bottom: 15px;
}

/*  .wid90 {
    width: 80%;
  } */
.wid90 {
  width: 90%;
}

.labelHeight {
  line-height: 35px;
}

#addRef .avatar-uploader>>>.el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

#addRef .avatar-uploader>>>.el-upload:hover {
  border-color: #409EFF;
}

#addRef .avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}

#addRef .avatar {
  width: 178px;
  height: 178px;
  display: block;
}

.showImgStyle {
  max-height: 251px;
  vertical-align: bottom;
}

.modifyImgBtn {
  position: absolute;
  right: -100px;
  bottom: 0;
}

.required-field:before {
  content: "*";
  color: red;
  margin-right: 2px;
}
</style>
